﻿using System.Threading.Tasks;
using Volo.Abp.Data;
using Volo.Abp.Identity;

namespace Leo.Awesome.AppPlatform.Seeds.Users
{
    public class IdentityAppDataSeedContributor : IdentityDataSeedContributor
    {
        //public const string AdminEmailPropertyName = "AdminEmail";
        //public const string AdminEmailDefaultValue = "admin@abp.io";
        //public const string AdminPasswordPropertyName = "AdminPassword";
        //public const string AdminPasswordDefaultValue = "1q2w3E*";
        //private readonly IIdentityDataSeeder identityDataSeeder;

        public IdentityAppDataSeedContributor(IIdentityDataSeeder identityDataSeeder) : base(identityDataSeeder)
        {
            //this.identityDataSeeder = identityDataSeeder;
        }

        public override async Task SeedAsync(DataSeedContext context)
        {
            await IdentityDataSeeder.SeedAsync(
             context?[AdminEmailPropertyName] as string ?? AdminEmailDefaultValue,
             context?[AdminPasswordPropertyName] as string ?? AdminPasswordDefaultValue,
             context?.TenantId
         );
        }
    }
}
